Conversation
… to test the stuff
API MuncherWhat We're Looking For
|
CheezItMan
left a comment
There was a problem hiding this comment.
I made one note on your controller testing, if you need me to look at more or other tests, just ping me back and I'll take a look.
|
|
||
| describe "#create" do | ||
|
|
||
| it "can create a search" do |
There was a problem hiding this comment.
For this test case the proc is preventing errors from occurring, because `post login_path, params: {user: users(:aurora)} is raising an error because it's unable to find the user, but the proc is containing it. So the next 2 lines of the test never get executed.
You're also including search terms, health and user as params, but the controller is checking session for them (not sure why).
The test should look like
it "can create a search" do
post login_path, params: {
provider: users(:aurora).provider,
uid: users(:aurora).uid
}
must_respond_with :redirect
proc {
post save_search_path, params: {
search: {
search_terms: "pink lady",
health: "vegetarian",
user_id: users(:aurora).id}
}
}.must_change 'Search.count', 1
must_respond_with :success
endAnd I think from looking at it that the controller should be using params to save the search, not session. I'm not sure why session is involved at all.
…s a before action
added link to heroku app
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
PLEASE HELP ME WITH THESE QUESTIONS!
THANK YOU!!